﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebNetCorePhoneErp.Model;

namespace WebNetCorePhoneErp.IBLL
{
    /// <summary>
    /// 人员-业务逻辑
    /// </summary>
    /// <remarks>
    /// 作者：王浩力
    /// 创建时间：2021-6-11 17:46:52
    /// </remarks>
    public interface IUserBusiness
    {
        /// <summary>
        /// 检查用户的登录
        /// </summary>
        /// <param name="userView">用户登录信息</param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-11 17:53:43 
        /// </remarks>
        Task<Result<UserView>> CheckUserLoginAsync(UserView userView);

        /// <summary>
        /// 根据id获取一个用户
        /// </summary>
        /// <param name="id">用户id</param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-11 17:58:32
        /// </remarks>
        Task<UserView> GetByIdAsync(string id);

        /// <summary>
        /// 新增一条用户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-11 17:58:32
        /// </remarks>
        Task<Result> AddAsync(Employee model);

        /// <summary>
        /// 修改一个用户记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-11 17:58:32
        /// </remarks>
        Task<Result> EditAsync(Employee model);

        /// <summary>
        /// 启用或禁用
        /// </summary>
        /// <param name="id">用户id</param>
        /// <param name="userView"></param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-15 10:59:06
        /// 作者：王浩力
        /// </remarks>
        Task<Result> UpdateStatAsync(string id, UserView userView);

        /// <summary>
        /// 重置用户密码
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userView"></param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-15 10:59:06
        /// 作者：王浩力
        /// </remarks>
        Task<Result> ResetPasswordAsync(string userId, UserView userView);

        /// <summary>
        /// 用户分页
        /// </summary>
        /// <param name="p">当前页码</param>
        /// <param name="rows">每页显示记录数</param>
        /// <param name="employee">查询条件</param>
        /// <returns></returns>
        /// <remarks>
        /// 创建时间：2021-6-11 17:58:32
        /// </remarks>
        Task<PageModel<Employee>> PageAsync(int p, int rows, Employee employee);

    }
}
